package com.example.hotHub.controller;

import com.example.hotHub.common.R;
import com.example.hotHub.model.Almanac;
import com.example.hotHub.service.DateWrapperService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@CrossOrigin
@Api(tags = "万年历爬取控制器")
@RestController
public class DateWrapperController {

    @Autowired
    private DateWrapperService dateWrapperService;

    @GetMapping("/almanac")
    public R getAlmanac(Integer year, Integer month, Integer day){
        Almanac almanac = dateWrapperService.getAlmanac(year, month, day);
        return R.success(almanac);
    }

}
